package com.yfree.views;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;

public class YTextView extends TextView {

    public YTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    public YTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public YTextView(Context context) {
        super(context);
        init();
    }

    private void init() {
        setSingleLine(false);
        setMaxLines(2);
        setEllipsize(TextUtils.TruncateAt.END);
    }

//    @Override
//    protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
//        if (focused) {
//            super.onFocusChanged(focused, direction, previouslyFocusedRect);
//        }
//    }
//
//    @Override
//    public void onWindowFocusChanged(boolean hasWindowFocus) {
//        if (hasWindowFocus) {
//            super.onWindowFocusChanged(hasWindowFocus);
//        }
//    }
//
//    @Override
//    @ExportedProperty(category = "focus")
//    public boolean isFocused() {
//        return true;
//    }
}
